#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)

#include <iostream>
using namespace std;

class Base 
{
public:
    Base()
    {
        cout << "virtual Base()" << endl;

    }

    void f(int a) 
    {
        cout << "Base::f(int a)" << endl;
    }
    virtual void g(int a) 
    {
        cout << "virtual Base::g(int a)" << endl;
    }

private:
    int m_a;
};

class Derived : public Base
{
public:
    void h(int a) 
    {
        cout << "Derivd::h(int a)" << endl;
    }
    void g(int a) 
    {
        cout << "virtual Derived::g(int a)" << endl;
    }
};

int main()
{
    Base b;
    b.f(3);
    b.g(4);

    Derived d;
    d.f(3);
    d.g(4);
    d.h(3);

    return 0;
}